<template>
  <div class="home">
    <!-- <h1>{{this.$store.state.counter}}</h1> -->
    <h1>{{counter}}</h1>
    <!-- <button @click="editName">修改name</button> -->
    <button @click="editNameA('lisi')">修改name</button>
  </div>
</template>

<script>
  import {
    mapActions,
    mapState
  } from 'vuex'
  export default {
    name: 'HomeView',
    computed: {
      /* counter(){
        return this.$store.state.counter
      } */
      ...mapState('aboutOption', ['counter'])
    },
    methods: {
      /* editName() {
         this.$store.dispatch('editNameA', 'lisi');
       } */
      ...mapActions('homeOption', ['editNameA'])
    }
  }
</script>
